import store from '@/store'

export const imgError = {
  inserted(dom, binging) {
    // console.log(dom, binging)
    dom.onerror = function() {
      dom.src = binging.value
    }
  }
}
// 自定义指令与功能权限
export const has = {
  inserted(dom, binging) {
    function isCan(key) {
      return store.state.permission.roles.poinrs.some(item => item === key)
    }
    if (!isCan(binging.value)) {
      dom.remove() // 删除此节点
    }
  }
}
